package com.huangyi.api;

import com.huangyi.model.ProductInfo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


public interface ProductInterface {
    @RequestMapping("/{productId}")
    ProductInfo getProductById(@PathVariable("productId") Integer productId);
    @RequestMapping("/p1")
    String getProductByName1(Integer id) ;
    @RequestMapping("/p2")
    String getProductByName(@RequestParam("id") Integer id, @RequestParam("name") String name);
    @RequestMapping("/p3")
    String getInfo (ProductInfo productInfo) ;
    @RequestMapping("/p4")
    String getInfoJson (@RequestBody ProductInfo productInfo);
}
